/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cl.edinet.agencialinea3.ejb.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author ivan
 */
@Entity
@Table(name = "ITEMS")
@NamedQueries({
    @NamedQuery(name = "Items.findAll", query = "SELECT i FROM Items i"),
    @NamedQuery(name = "Items.findByCodigoItems", query = "SELECT i FROM Items i WHERE i.codigoItems = :codigoItems"),
    @NamedQuery(name = "Items.findByNombreItems", query = "SELECT i FROM Items i WHERE i.nombreItems = :nombreItems"),
    @NamedQuery(name = "Items.findByAtributo1", query = "SELECT i FROM Items i WHERE i.atributo1 = :atributo1"),
    @NamedQuery(name = "Items.findByAtributo2", query = "SELECT i FROM Items i WHERE i.atributo2 = :atributo2"),
    @NamedQuery(name = "Items.findByAtributo3", query = "SELECT i FROM Items i WHERE i.atributo3 = :atributo3"),
    @NamedQuery(name = "Items.findByAtributo4", query = "SELECT i FROM Items i WHERE i.atributo4 = :atributo4"),
    @NamedQuery(name = "Items.findByAtributo5", query = "SELECT i FROM Items i WHERE i.atributo5 = :atributo5"),
    @NamedQuery(name = "Items.findByAtributo6", query = "SELECT i FROM Items i WHERE i.atributo6 = :atributo6"),
    @NamedQuery(name = "Items.findByAjuste", query = "SELECT i FROM Items i WHERE i.ajuste = :ajuste"),
    @NamedQuery(name = "Items.findByCantidadMercancia", query = "SELECT i FROM Items i WHERE i.cantidadMercancia = :cantidadMercancia"),
    @NamedQuery(name = "Items.findByCodigoArancel", query = "SELECT i FROM Items i WHERE i.codigoArancel = :codigoArancel"),
    @NamedQuery(name = "Items.findByValorCifItem", query = "SELECT i FROM Items i WHERE i.valorCifItem = :valorCifItem"),
    @NamedQuery(name = "Items.findByPrecioFob", query = "SELECT i FROM Items i WHERE i.precioFob = :precioFob"),
    @NamedQuery(name = "Items.findByPrecioUnFob", query = "SELECT i FROM Items i WHERE i.precioUnFob = :precioUnFob"),
    @NamedQuery(name = "Items.findByPresoBruto", query = "SELECT i FROM Items i WHERE i.presoBruto = :presoBruto")})
public class Items implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "CODIGO_ITEMS")
    private BigDecimal codigoItems;
    @Size(max = 50)
    @Column(name = "NOMBRE_ITEMS")
    private String nombreItems;
    @Size(max = 50)
    @Column(name = "ATRIBUTO_1")
    private String atributo1;
    @Size(max = 50)
    @Column(name = "ATRIBUTO_2")
    private String atributo2;
    @Size(max = 50)
    @Column(name = "ATRIBUTO_3")
    private String atributo3;
    @Size(max = 50)
    @Column(name = "ATRIBUTO_4")
    private String atributo4;
    @Size(max = 50)
    @Column(name = "ATRIBUTO_5")
    private String atributo5;
    @Size(max = 50)
    @Column(name = "ATRIBUTO_6")
    private String atributo6;
    @Size(max = 50)
    @Column(name = "AJUSTE")
    private String ajuste;
    @Column(name = "CANTIDAD_MERCANCIA")
    private BigInteger cantidadMercancia;
    @Column(name = "CODIGO_ARANCEL")
    private BigInteger codigoArancel;
    @Column(name = "VALOR_CIF_ITEM")
    private BigInteger valorCifItem;
    @Column(name = "PRECIO_FOB")
    private BigInteger precioFob;
    @Column(name = "PRECIO_UN_FOB")
    private BigInteger precioUnFob;
    @Column(name = "PRESO_BRUTO")
    private BigInteger presoBruto;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "itemsCodigoItems")
    private List<AcuerdoComercial> acuerdoComercialList;
    @JoinColumn(name = "UNIDAD_MEDIDA", referencedColumnName = "CODIGO")
    @ManyToOne(optional = false)
    private UnidadMedida unidadMedida;
    @JoinColumn(name = "DOCUMENTO_NUMERO_DESPACHO", referencedColumnName = "NUMERO_DESPACHO")
    @ManyToOne
    private Documento documentoNumeroDespacho;
    @JoinColumn(name = "DECLARACION_NUMERO_DESPACHO", referencedColumnName = "NUMERO_DESPACHO")
    @ManyToOne
    private Declaracion declaracionNumeroDespacho;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "itemsCodigoItems")
    private List<CuentasValoresItem> cuentasValoresItemList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "itemsCodigoItems")
    private List<Observacion> observacionList;

    public Items() {
    }

    public Items(BigDecimal codigoItems) {
        this.codigoItems = codigoItems;
    }

    public BigDecimal getCodigoItems() {
        return codigoItems;
    }

    public void setCodigoItems(BigDecimal codigoItems) {
        this.codigoItems = codigoItems;
    }

    public String getNombreItems() {
        return nombreItems;
    }

    public void setNombreItems(String nombreItems) {
        this.nombreItems = nombreItems;
    }

    public String getAtributo1() {
        return atributo1;
    }

    public void setAtributo1(String atributo1) {
        this.atributo1 = atributo1;
    }

    public String getAtributo2() {
        return atributo2;
    }

    public void setAtributo2(String atributo2) {
        this.atributo2 = atributo2;
    }

    public String getAtributo3() {
        return atributo3;
    }

    public void setAtributo3(String atributo3) {
        this.atributo3 = atributo3;
    }

    public String getAtributo4() {
        return atributo4;
    }

    public void setAtributo4(String atributo4) {
        this.atributo4 = atributo4;
    }

    public String getAtributo5() {
        return atributo5;
    }

    public void setAtributo5(String atributo5) {
        this.atributo5 = atributo5;
    }

    public String getAtributo6() {
        return atributo6;
    }

    public void setAtributo6(String atributo6) {
        this.atributo6 = atributo6;
    }

    public String getAjuste() {
        return ajuste;
    }

    public void setAjuste(String ajuste) {
        this.ajuste = ajuste;
    }

    public BigInteger getCantidadMercancia() {
        return cantidadMercancia;
    }

    public void setCantidadMercancia(BigInteger cantidadMercancia) {
        this.cantidadMercancia = cantidadMercancia;
    }

    public BigInteger getCodigoArancel() {
        return codigoArancel;
    }

    public void setCodigoArancel(BigInteger codigoArancel) {
        this.codigoArancel = codigoArancel;
    }

    public BigInteger getValorCifItem() {
        return valorCifItem;
    }

    public void setValorCifItem(BigInteger valorCifItem) {
        this.valorCifItem = valorCifItem;
    }

    public BigInteger getPrecioFob() {
        return precioFob;
    }

    public void setPrecioFob(BigInteger precioFob) {
        this.precioFob = precioFob;
    }

    public BigInteger getPrecioUnFob() {
        return precioUnFob;
    }

    public void setPrecioUnFob(BigInteger precioUnFob) {
        this.precioUnFob = precioUnFob;
    }

    public BigInteger getPresoBruto() {
        return presoBruto;
    }

    public void setPresoBruto(BigInteger presoBruto) {
        this.presoBruto = presoBruto;
    }

    public List<AcuerdoComercial> getAcuerdoComercialList() {
        return acuerdoComercialList;
    }

    public void setAcuerdoComercialList(List<AcuerdoComercial> acuerdoComercialList) {
        this.acuerdoComercialList = acuerdoComercialList;
    }

    public UnidadMedida getUnidadMedida() {
        return unidadMedida;
    }

    public void setUnidadMedida(UnidadMedida unidadMedida) {
        this.unidadMedida = unidadMedida;
    }

    public Documento getDocumentoNumeroDespacho() {
        return documentoNumeroDespacho;
    }

    public void setDocumentoNumeroDespacho(Documento documentoNumeroDespacho) {
        this.documentoNumeroDespacho = documentoNumeroDespacho;
    }

    public Declaracion getDeclaracionNumeroDespacho() {
        return declaracionNumeroDespacho;
    }

    public void setDeclaracionNumeroDespacho(Declaracion declaracionNumeroDespacho) {
        this.declaracionNumeroDespacho = declaracionNumeroDespacho;
    }

    public List<CuentasValoresItem> getCuentasValoresItemList() {
        return cuentasValoresItemList;
    }

    public void setCuentasValoresItemList(List<CuentasValoresItem> cuentasValoresItemList) {
        this.cuentasValoresItemList = cuentasValoresItemList;
    }

    public List<Observacion> getObservacionList() {
        return observacionList;
    }

    public void setObservacionList(List<Observacion> observacionList) {
        this.observacionList = observacionList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codigoItems != null ? codigoItems.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Items)) {
            return false;
        }
        Items other = (Items) object;
        if ((this.codigoItems == null && other.codigoItems != null) || (this.codigoItems != null && !this.codigoItems.equals(other.codigoItems))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cl.edinet.agencialinea3.ejb.entity.Items[ codigoItems=" + codigoItems + " ]";
    }
    
}
